package com.test.consumer.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    private HelloFeignService helloFeignService;

    /**
     *
     * @param name 参数一定要加注释， 不然不识别
     * @return
     */
    @GetMapping(value = "/hello")
    public String doHello(@RequestParam("name") String name){
        return helloFeignService.sayHello(name);
    }

    /***
     *
     * @param name 参数一定要加注释， 不然不识别
     * @return
     */
    @GetMapping("/test")
    public String feignTest(@RequestParam("name") String name){
        return helloFeignService.feignTest(name);
    }
}

